import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/home/Home.vue'
import Info from "@/views/info/Info";
import Mailbox from "@/views/mailbox/Mailbox";
import Index from "@/views/Index";
import Match from "@/views/chat/Match";
import Chatpage from "@/views/chat/Chatpage";


Vue.use(VueRouter)

  const routes = [
    {
      path: '/',
      redirect:'/index/home'
    },
    {
      path: '/index',
      component: Index,
      name:"index",
      children:[
        {
          path: "home",
          name: 'home',
          component: Home,

        },
        {
          path: "chat",
          name:"chat",
          component: Match
        }
        ,
        {
          path: "info",
          name:"info",
          component: Info
        }
        ,
        {
          path: "mailbox",
          name:"mailbox",
          component: Mailbox
        }
      ]
    },
    {
      path:"/chat",
      component: Chatpage
    }
  ]

const router = new VueRouter({
  routes
})

export default router
